var http = require("http");
var url = require("url");
var app = http.createServer(function (request, response) {
    response.setHeader('Access-Control-Allow-Origin', 'null');
    // response.writeHeader(200, {
    //     'content-type': 'text/html;charset="utf-8"'
    // });
    // 接受请求的url
    var url_json = url.parse(request.url);
    var url_str = JSON.stringify(url_json);

    if (url_json.path !== "/favicon.ico") {
        response.write(url_str);
        console.log(url_json.path);
    }
    response.end("hello world\n");
}).listen(8888, function () {
    console.log('Server running at http://127.0.0.1:8888/');
});
